r = 1 misrell = 1 helen = 1 youngconductor = 1 oldconductor = 1 jane = 1 boy = 1 olderboy = 1 SCREEN 12 COLOR 15, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 30 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 14) AS STRING directions(1) = "EAST" directions(2) = "EAST, WEST, OR SOUTH" directions(3) = "WEST" directions(4) = "NORTH OR SOUTH" directions(5) = "NORTH OR EAST" directions(6) = "WEST OR SOUTH" directions(7) = "NORTH OR SOUTH" directions(8) = "NORTH OR WEST" directions(9) = "EAST OR SOUTH" directions(10) = "NORTH OR SOUTH" directions(11) = "WEST OR NORTH" directions(12) = "NORTH OR EAST" directions(13) = "WEST OR SOUTH" directions(14) = "EAST" PRINT "" PRINT "" PRINT "______________________________________________________________________" PRINT "|This is Gart Williams, age thirty eight, a man protected by a suit |" PRINT "|of armor all held together by one bolt. Just a moment ago, someone |" PRINT "|removed the bolt and Mr. William's protection fell away from him and|" PRINT "|left him a naked target. He's been cannonaded this afternoon by all |" PRINT "|the enemies of his life. His insecurity has shelld him; his |" PRINT "|sensitivity has straddled him with humiliation; his deep-rooted |" PRINT "|disquiet about his own worth has zeroed in on him, landed on target,|" PRINT "|and blown him apart. Mr. Gart Williams, ad agency exec, who in just |" PRINT "|a moment will move into the Twilight Zone in a desperate search for |" PRINT "|survival! |" PRINT "_____________________________________________________________________|" DO: LOOP UNTIL INKEY$ <> "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT "The Twilight Zone" PRINT " A Stop at Willoughby" PRINT " Written by Rod Serling" PRINT " Coded by D.B. Taylor" PRINT PRINT "" PRINT " MAY 2, 2016" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 IF r = 10 THEN: GOSUB r10 IF r = 11 THEN: GOSUB r11 IF r = 12 THEN: GOSUB r12 IF r = 13 THEN: GOSUB r13 IF r = 14 THEN: GOSUB r14 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "TALK - TALK TO SOMEONE" PRINT "KILL - KILL AT YOUR OWN RISK" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT PRINT "YOU ARE IN THE TWILIGHT ZONE...THERE ARE NO ITEMS TO COLLECT!" PRINT DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 2: GOTO moved IF r = 8 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 11 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 9: GOTO moved IF r = 12 THEN: r = 13: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 3: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 9 THEN: r = 8: GOTO moved IF r = 12 THEN: r = 11: GOTO moved IF r = 14 THEN: r = 13: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 2 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 6 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 8: GOTO moved IF r = 9 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 11: GOTO moved IF r = 13 THEN: r = 12: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 1: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 8 THEN: r = 9: GOTO moved IF r = 11 THEN: r = 12: GOTO moved IF r = 13 THEN: r = 14: GOTO moved END IF IF (cmd$ = "EXAMINE ROD") THEN CLS PRINT "You a short yet strong voice man, smoking a freshly lit" PRINT "cigarette. His black suit is freshly pressed and he has a" PRINT "look upon his face that strikes fear and interest." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO ROD") THEN CLS PRINT "Nothing is what it seems. That's all you'll be getting out" PRINT "of me." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF ''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "EXAMINE MISRELL") AND r = 1 THEN CLS PRINT "An old man, large in size, with an expensive cigar hanging" PRINT "from the corner of his mouth. He's fuming at the lid stirred" PRINT "by anger and nerves." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO MISRELL") AND r = 1 THEN CLS PRINT "Did you hear what I said, Williams? That account represented a" PRINT "gross billings of something in the neighborhood of three million" PRINT "dollars a year. And how many times have you promised it to me?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF ''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "EXAMINE HELEN") AND r = 2 THEN CLS PRINT "A stunning blonde, in her late twenties, hoping to leave this world" PRINT "of offices and desks. A worried look is upon her face." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO HELEN") AND r = 2 THEN CLS PRINT "Messages on the desk, boss. And hot coffee out here." PRINT "it right." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF ''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "EXAMINE YOUNG CONDUCTOR") AND r = 4 THEN CLS PRINT "He looks like a tired man. To tired to be that age and look that" PRINT "bored. He punchs ticket after ticket until he comes up to you." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO YOUNG CONDUCTOR") AND r = 4 THEN CLS PRINT "Cold winter this year. Seems to get darker earlier than it ever has." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF ''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "EXAMINE OLD CONDUCTOR") AND r = 5 THEN CLS PRINT "Wearing old-fashioned dress. He greets you with a smile." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO OLD CONDUCTOR") AND r = 5 THEN CLS PRINT "Willoughby. This stop is Willoughby! Everybody out." PRINT "" PRINT "WILLOUGHBY" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "WILLOUGHBY") AND r = 5 THEN CLS PRINT "Willoughby, sir? That's Willoughby right outside. Willoughby." PRINT "July. Summer. It's 1888. It's a lovely little village. You ought" PRINT "to try it sometime!" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF '''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "TALK TO YOUNG CONDUCTOR") AND r = 6 THEN CLS PRINT "Westport-Saugatuck next stop. Have a good sleep Mr. Williams?" PRINT "" PRINT "WILLOUGHBY" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "WILLOUGHBY") AND r = 6 THEN CLS PRINT "Willoughby? Willoughby where? There's no Willoughby on the line." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF ''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "EXAMINE JANE") AND r = 7 THEN CLS PRINT "A tired and bored woman that is sadly your wife. She looks unimpressed" PRINT "with life except for looking like the best. Money is her true love." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO JANE") AND r = 7 THEN CLS PRINT "I'm sick and tired Gart. Sick and tired of you being a fool, crying about" PRINT "life, wanting to play Huck Finn, while the rest have to live in the real world." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF ''''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "TALK TO YOUNG CONDUCTOR") AND r = 8 THEN CLS PRINT "Last week you asked me about a town called Willoughby, Mr. Williams." PRINT "I looked it up. Every old timetable I could find. No such place as far" PRINT "as I could see." PRINT "" PRINT "You: Thanks, It was a dream, that's all." PRINT "" PRINT "Probably was." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF '''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "TALK TO OLD CONDUCTOR") AND r = 9 THEN CLS PRINT "Willoughby. Next stop Willoughby.." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF '''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "ANSWER PHONE") AND r = 10 THEN CLS PRINT "What we need here, Williams, is a show with zazz! An entertainer with" PRINT "moxie! We've got to take the audience by the ears and give 'em a yank!" PRINT "Jar 'em! Rock 'em! Give them the old push, push, push!" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "CALL OUT TO HELEN") AND r = 10 THEN CLS PRINT "I'll have to check it, sir. Mr. Misrell would like to see you." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF '''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "TALK TO BOY") AND r = 14 THEN CLS PRINT "Hi, Mr. Williams." PRINT "" PRINT "PLENTY OF FISH" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "PLENTY OF FISH") AND r = 14 THEN CLS PRINT "Plenty of room! And lotsa fish." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO OLDER BOY") AND r = 14 THEN CLS PRINT "Hi, Mr. Williams." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' IF (cmd$ = "WALK TO BAND STAND" OR cmd$ = "WALK TO BAND") AND r = 14 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "________________________________________________________________________" PRINT " You are standing in a stuffy board room, all eye's are upon you even " PRINT " those belonging to MR. MISRELL. " PRINT " " PRINT " EXAMINE MISRELL or TALK TO MISRELL " PRINT "________________________________________________________________________" RETURN r2: PRINT "________________________________________________________________________" PRINT " You scramble out into the hall. The way to your office is littered with" PRINT " receptionist's desks and with all eye's on you, you feel as if you " PRINT " need a break from this hectic nonsense of a job you subject yourself to" PRINT " on a daily basis. You see HELEN sitting at her desk. " PRINT ""; "" PRINT " EXAMINE HELEN or TALK TO HELEN " PRINT "________________________________________________________________________" RETURN r3: PRINT "________________________________________________________________________" PRINT " A poorly lit office, decorated with little tokens from your private " PRINT " life. You can feel your knee's begin to give way. Maybe sitting down " PRINT " would be the best option? " PRINT "________________________________________________________________________" RETURN r4: PRINT "________________________________________________________________________" PRINT " A barely filled train car. The smell of cigar smoke embraces you. The " PRINT " shuffling of newspaper pages and footsteps from the YOUNG CONDUCTOR " PRINT " and those who are unsure of what seat to take for the long journey home." PRINT "" PRINT " TALK TO YOUNG CONDUCTOR or EXAMINE YOUNG CONDUCTOR " PRINT "________________________________________________________________________" RETURN r5: PRINT "________________________________________________________________________" PRINT " You awaken to find yourself in another place and time. Walking down the" PRINT " the aisle, you see an OLD CONDUCTOR, one who you haven't seen before. " PRINT "" PRINT " TALK TO OLD CONDUCTOR " PRINT "________________________________________________________________________" RETURN r6: PRINT "________________________________________________________________________" PRINT " You awake to find yourself back in the old smoke filled passenger car. " PRINT " A feeling of uncertainity and yet joy washes over you. Just what had " PRINT " happened to you? You see the YOUNG CONDUCTOR. " PRINT "" PRINT " TALK TO YOUNG CONDUCTOR " PRINT "________________________________________________________________________" RETURN r7: PRINT "________________________________________________________________________" PRINT " You are standing within the confines of your home. A nicely decorated " PRINT " home, made up of fine pieces of art, and a sense of wealth oozes from " PRINT " every pore. You see your tired wife JANE, look upon you with disgust. " PRINT "" PRINT " TALK TO JANE or EXAMINE JANE " PRINT "________________________________________________________________________" RETURN r8: PRINT "________________________________________________________________________" PRINT " The smell of smoke dwindles as an eerie silence fills the air. As the " PRINT " YOUNG CONDUCTOR walks down the aisle. " PRINT "________________________________________________________________________" RETURN r9: PRINT "________________________________________________________________________" PRINT " The melody's of old music fill the air. The smell of a less polluted " PRINT " world, children laughing in the distance, and conversations from those " PRINT " merry people who have not to know the hardships of a technologically " PRINT " advanced world. " PRINT "" PRINT " CALL OUT TO CONDUCTOR " PRINT "________________________________________________________________________" RETURN r10: PRINT "________________________________________________________________________" PRINT " You are sitting at your desk. The harsh pounding within your chest acts" PRINT " like a jack hammer carving up the pavement. Your PHONE RINGS and you " PRINT " are dreading just who's on the other line. HELEN is at her desk and you" PRINT " are yearning to be home. Maybe a call to your wife JANE is in order. " PRINT "" PRINT " ANSWER PHONE or CALL OUT TO HELEN " PRINT "________________________________________________________________________" RETURN r11: PRINT "________________________________________________________________________" PRINT " You feel that the weight of the world is upon your shoulders. A warm " PRINT " sweat washes upon your face. A cold rinse of water may help WASH FACE. " PRINT " But your not alone, as Mr. Misrell is calling out to you in the vien " PRINT " attempt of having you go above and beyond what you are use too. " PRINT "________________________________________________________________________" RETURN r12: PRINT "________________________________________________________________________" PRINT " While you are sitting down on the hard wooden bench. You are at ends " PRINT " with what you were told during those early years of life. Hard work and" PRINT " and the odd reward is starting to take its toll upon you. You dream of " PRINT " an escape, you dream of a better time, a simplier time. You dream of " PRINT " Willoughby, this time you aren't coming back, this time your staying. " PRINT " You don't even notice when the Conductor punches your ticket. You lean " PRINT " back and begin to feel drowsy. " PRINT "________________________________________________________________________" RETURN r13: PRINT "________________________________________________________________________" PRINT " The warmth of the summer month embraces you like a warm hug. A gentle " PRINT " tune plays off in the distance. It's calling out to you. " PRINT "________________________________________________________________________" RETURN r14: PRINT "________________________________________________________________________" PRINT " Your standing on the platform of the train station. Your greeted by a " PRINT " few of the locals. There you see a BOY with an OLDER BOY, carrying the " PRINT " the catch from the river. You see a small freshly painted BAND STAND " PRINT " holding within it, a small six player band. A summer day like this is " PRINT " what one dreams for. Freeing oneself from the hectic confines of the " PRINT " world we allowed ourselves to be a part of. " PRINT "" PRINT " TALK TO BOY or TALK TO OLDER BOY or WALK TO BAND STAND " PRINT "________________________________________________________________________" RETURN win: COLOR 15, 0 CLS PRINT "Mr. Gart Williams, who sought respite fromt torment under a gravestone; who" PRINT "climbed on a world that went by too fast and then...jumped off. Mr. Gart" PRINT "Williams, who might now tell us this, too, is a part of...The Twilight Zone!" PRINT "" PRINT "" PRINT "-----------------------------------------------------------------------------------" PRINT "Thank you for playing" PRINT PRINT "-The Twilight Zone - A Stop at Willoughby-" PRINT "" PRINT "Coded by D.B. Taylor" DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You find yourself, trapped between the gateway of reality and a dimension" PRINT "not none by man. You are now a resident of The Twilight Zone." _DISPLAY END END SUB